package com.shiguiwu.springmybatis.designpattern.adapter;

/**
 * @description: audioPlayer  音频播放器
 * @author: stone
 * @date: Created by 2021/2/23 16:37
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springmybatis.designpattern.adapter
 */
public class AudioPlayer implements MediaPlayer {

    private MediaAdapter mediaAdapter;

    @Override
    public void play(String audioType, String fileName) {
        if ("mp3".equalsIgnoreCase(audioType)) {
            System.out.println("内置支持MP3......" + fileName);
        }
        else if ("mp4".equalsIgnoreCase(audioType) || "vlc".equalsIgnoreCase(audioType)) {
            mediaAdapter = new MediaAdapter(audioType);
            mediaAdapter.play(audioType,fileName);
        }
        else {
            System.err.println("不支持播放类型。。。。。。。。");
        }
    }
}
